/**
 * 水球图颜色
 * @param {*} value
 * @returns
 */
export const getColor = (value) => {
  return value > 0 && value <= 0.5
    ? 'rgba(97,216,0,.7)'
    : value > 0.5 && value <= 0.8
    ? 'rgba(204,178,26,.7)'
    : value > 0.8
    ? 'rgba(241,47,28,.7)'
    : '#c7c7cb'
}

/**
  const testPoint = [
    {
      name: '海门',
      value: [121.15, 31.89, 80]
    },
    {
      name: '南京',
      value: [118.78, 32.04, 100]
    }
  ]
 * 将数据打造成以上格式
 * @returns
 */
export const conbinaMapData = function (cities, geoCoordMap) {
  const result = []
  cities.forEach((item) => {
    const { name, value } = item
    const coord = geoCoordMap[name] // 拿到坐标信息
    result.push({
      name,
      value: [...coord, value]
    })
  })
  return result
}
